"""
Copyright (c) 2022 Guangdong University of Technology
PhotLab is licensed under [Open Source License].
You can use this software according to the terms and conditions of the [Open Source License].
You may obtain a copy of [Open Source License] at: [https://open.source.license/]

THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.

See the [Open Source License] for more details.

Author: Meng Xiang, Junjiang Xiang
Created: 2023/8/19
Supported by: National Key Research and Development Program of China
"""
import numpy as np


def down_sample(input, down_sampling_factor = 2):
    """

    Args:
        input: 数据
        factor:下采样倍数

    Returns:

    """
    downsampled_signal = input[0:len(input):down_sampling_factor]

    return downsampled_signal


if __name__ == '__main__':
    bits_1 = np.random.randint(0, 2, size=(20))
    down_sample_data = down_sample(bits_1, 2)
    print(bits_1)
    print(down_sample_data)

    print("OK")